<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>nginx_test</title>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
  	var data = '{"data":{"id":"1","attributes":{"code":"test","loginType":null,"loginName":"wangcheng","name":"......","entName":null,"password":"wangcheng","avatar":"wangcheng.png","desc":null,"introduce":null,"sex":1,"age":null,"phone":82548974,"email":null,"weixin":null,"address":"11","invite":null,"alipay":null},"relationships":{"role":{"data":{"type":"role","id":"1"}},"cstag":null,"extendInfo":{"data":{"type":"userextend","id":"1"}}},"type":"user"}}';
    $.ajax({
    	url:"http://192.168.1.106:9080/api/user/1",
    	async:true,
    	method:'patch',
    	headers:{
    		"Accept":"application/vnd.api+json",
    		"Accept-Encoding":"gzip, deflate, sdch",
    		"Content-type":"application/vnd.api+json",
    	},
    	data:data,
    	success: function(data){
    		alert("success");
    	},
    	error : function(e) {    
          // view("异常！");    
          alert("请求错误:" + e.statusText);
     	} 
    });  	
  });
});
</script>
</head>
<body>

<p>Hello World</p>
<div id="div1"></div>
<button>获取数据</button>

</body>
</html>
